
@use '@toms/element-ui/theme-chalk/src/mixins/mixins' as *;
@include b(message-box) {
  display: inline-block;
  width: var(--el-messagebox-width);
  padding-top: var(--padding-base);
  padding-bottom: 0;
  vertical-align: middle;
  background-color: var(--color-white);
  border-radius: var(--el-border-radius-large);
  border: 1px solid var(--el-border-color-lighter);
  font-size: var(--font-size-large);
  box-shadow: var(--el-box-shadow-light);
  text-align: left;
  overflow: hidden;
  backface-visibility: hidden;

  @include e(wrapper) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;

    &::after {
      content: '';
      display: inline-block;
      height: 100%;
      width: 0;
      vertical-align: middle;
    }
  }

  @include e(header) {
    position: relative;
    padding: var(--padding-base);
    padding-bottom: 0px;
    padding-top: 0px;
    margin-bottom: 8px;
  }

  @include e(title) {
    padding-left: 0;
    margin-bottom: 0;
    display: flex;
    font-weight: 600;
    font-size: var(--font-size-medium);
    line-height:  24px;
    color: var(--el-messagebox-title-color);
  }

  @include e(headerbtn) {
    position: absolute;
    top: var(--el-msgbox-padding-primary);
    right: var(--el-msgbox-padding-primary);
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--el-message-close-size);
    cursor: pointer;

    .el-message-box__close {
      color: var(--el-color-info);
    }

    &:focus,
    &:hover {
      .el-message-box__close {
        color: var(--el-color-primary);
      }
    }
  }

  @include e(content) {
    padding: 0 var(---padding-base);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    line-height: 22px;
  }


  @include e(input) {
    padding-top: 15px;

    & input.invalid {
      border-color: var(--color-danger);

      &:focus {
        border-color: var(--color-danger);
      }
    }
  }

  @include e(status) {
    position: relative;
    font-size: 24px !important;
    top: 0;
    margin-right: 16px;
    transform: translateY(0);

    + .el-message-box__message {
      padding-left: 36px;
      padding-right: 12px;
    }

    &.el-icon-success {
      color: var(--color-success);
    }

    &.el-icon-info {
      color: var(--color-primary);
    }

    &.el-icon-warning {
      color: var(--color-warning);
    }

    &.el-icon-error {
      color: var(--color-danger);
    }

    &.is-delete {
      color: var(--color-danger);
    }
  }

  @include e(message) {
    margin: 0;

    & p {
      margin: 0;
      line-height: 22px;
    }
  }

  @include e(errormsg) {
    color: var(--color-danger);
    font-size: var(--el-messagebox-error-font-size);
    min-height: 18px;
    margin-top: 2px;
  }

  @include e(btns) {
    padding: var(--padding-base);
    padding-top: 0px;
    margin-top: var(--padding-base);
    text-align: right;

    & button:nth-child(2) {
      margin-left: 8px;
    }
  }

  @include e(btns-reverse) {
    flex-direction: row-reverse;
  }

  // centerAlign 布局
  @include m(center) {
    padding-bottom: 30px;

    @include e(header) {
      padding-top: 30px;
    }

    @include e(title) {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    @include e(status) {
      position: relative;
      top: auto;
      padding-right: 5px;
      text-align: center;
      transform: translateY(-1px);
    }

    @include e(message) {
      margin-left: 0;
    }

    @include e((btns, content)) {
      text-align: center;
    }
  }
}